cmake_minimum_required(VERSION 2.6)
project(Xanguli)

set(CMAKE_BUILD_TYPE Debug)
add_executable(xanguli
               Xanguli.cpp
               TkWidget.cpp
               Controller.cpp
               IdGenerator.cpp
               DBusProxy.cpp
               DBusInterface.cpp
               XanguliException.cpp
               ServerObject.cpp
               Variant.cpp
               Marshal.cpp
               org_xanguli_Xanguli.h
               org_xanguli_Controller.h
               org_freedesktop_DBus_Introspectable.h)

add_executable(test-client
               test-client.cpp)

add_custom_command(OUTPUT org_xanguli_Xanguli.h
                   COMMAND ./dbus-generator.rb -n Xanguli org.xanguli.Xanguli.xml
                   DEPENDS org.xanguli.Xanguli.xml dbus-generator.rb interface-template.erb)		

add_custom_command(OUTPUT org_xanguli_Controller.h
                   COMMAND ./dbus-generator.rb -n Xanguli org.xanguli.Controller.xml
                   DEPENDS org.xanguli.Xanguli.xml dbus-generator.rb interface-template.erb)		

add_custom_command(OUTPUT org_freedesktop_DBus_Introspectable.h
                   COMMAND ./dbus-generator.rb -n Xanguli org.freedesktop.DBus.Introspectable.xml
                   DEPENDS org.xanguli.Xanguli.xml dbus-generator.rb interface-template.erb)		

include_directories(/usr/include
                    /usr/include/tcl8.5 
                    /usr/include/dbus-1.0 
                    /usr/lib/dbus-1.0/include 
                    /usr/include/c++/4.3
                    /usr/include/dbus-1.0
                    /usr/include/glib-2.0
                    /usr/lib/glib-2.0/include)

target_link_libraries(xanguli libtcl8.5.so libtk8.5.so libdbus-1.so)
target_link_libraries(test-client libdbus-glib-1.so)
